function isMobile() {
    return navigator.userAgent.match(/(iphone|ipad|ipod|ios|android|mobile|blackberry|iemobile|mqqbrowser|juc|fennec|wosbrowser|browserng|Webos|symbian|windows phone)/i);
}

var GLOBAL_KEYS = isMobile() ? "mobile" : "pc"

var GLOBAL_EVENT_OBJECT = {
	"pc": {"normalClick": "click", "endClick": "click",},
	"mobile": {"normalClick": "touchstart", "endClick": "touchend",},
}
var getNormalClickEvent = function() {
	return GLOBAL_EVENT_OBJECT[GLOBAL_KEYS].normalClick
}

var getEndClickEvent = function() {
	return GLOBAL_EVENT_OBJECT[GLOBAL_KEYS].endClick	
}

var lastTouchEnd = 0

var stopUserScaleScreenIOS = function() {
	if (GLOBAL_KEYS == "pc") {
		return
	}	
	document.documentElement.addEventListener('touchstart', function (event) {
		  if (event.touches.length > 1) {
		    event.preventDefault();
		  }
		}, false);
	document.documentElement.addEventListener('touchend', function (event) {
	  var now = Date.now();
	  if (now - lastTouchEnd <= 300) {
	    event.preventDefault();
	  }
	  lastTouchEnd = now;
	}, false);	
}


// 获得横竖屏
var isHorizontalScreen = function() {
	
	var width = document.documentElement.clientWidth;
	var height =  document.documentElement.clientHeight;
	return width > height
}
